package com.obixlabs.security.credentialsstore.services;

import java.rmi.RemoteException;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import com.obixlabs.security.credentialsstore.exception.EntryNotFoundException;
import com.obixlabs.security.credentialsstore.model.ObixGroups;
import com.obixlabs.security.credentialsstore.model.ObixPermission;
import com.obixlabs.security.credentialsstore.model.ObixPermissions;

@WebService(name=PermissionsManagementService.SERVICE_NAME, 
		targetNamespace=SecurityServiceConstants.SECURITY_SERVICES_TARGET_NAMESPACE)
public interface PermissionsManagementService extends SecurityService
{	
	String SERVICE_NAME = "PermissionsManagementService";
	
	@WebMethod(operationName="getAllPermissions")
	ObixPermissions getAllPermissions()
					throws RemoteException;
	
	@WebMethod(operationName="getPermissions")
	ObixPermission 	getPermission(@WebParam String name)
					throws RemoteException;
	
	
	@WebMethod(operationName="getGroupsAssignedTo")
	ObixGroups getGroupsAssignedTo(ObixPermission permission)
				throws 	RemoteException, EntryNotFoundException;	
			
	@WebMethod(operationName="addPermission")
	void savePermission(@WebParam ObixPermission permission)
				throws RemoteException;
	
	@WebMethod(operationName="deletePermission")
	void deletePermission(	@WebParam ObixPermission permission)
						throws RemoteException;	
}//end class def